Skip to content

Conversation

nthtrung09it
Copy link

@nthtrung09it nthtrung09it commented Oct 5, 2025

Summary

  • Add speechConfig field to GenerationConfig TypedDict for Gemini TTS requests

Changes

  • Added speechConfig: SpeechConfig to the GenerationConfig in litellm/types/llms/vertex_ai.py

This fix ensures that the speechConfig parameter can be properly passed in Gemini text-to-speech API requests.

Test plan

Request before applying the fix:

litellm-dev-litellm-855cf484f4-fkkwc litellm POST Request Sent from LiteLLM:
litellm-dev-litellm-855cf484f4-fkkwc litellm curl -X POST \
litellm-dev-litellm-855cf484f4-fkkwc litellm https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-preview-tts:generateContent?key=*****\
litellm-dev-litellm-855cf484f4-fkkwc litellm -H 'Content-Type: application/json' \
litellm-dev-litellm-855cf484f4-fkkwc litellm -d '{'contents': [{'role': 'user', 'parts': [{'text': 'Pronounce the word ***'}]}], 'generationConfig': {'responseModalities': ['AUDIO']}}'

Request after applying the fix:

litellm-dev-litellm-7768489884-p69tz litellm POST Request Sent from LiteLLM:
litellm-dev-litellm-7768489884-p69tz litellm curl -X POST \
litellm-dev-litellm-7768489884-p69tz litellm https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro-preview-tts:generateContent?key=*****\
litellm-dev-litellm-7768489884-p69tz litellm -H 'Content-Type: application/json' \
litellm-dev-litellm-7768489884-p69tz litellm -d '{'contents': [{'role': 'user', 'parts': [{'text': 'Pronounce the word ***'}]}], 'generationConfig': {'responseModalities': ['AUDIO'], 'speechConfig': {'voiceConfig': {'prebuiltVoiceConfig': {'voiceName': 'algenib'}}}}}'

Copy link

vercel bot commented Oct 5, 2025

Someone is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Oct 5, 2025

CLA assistant check
All committers have signed the CLA.

@nthtrung09it nthtrung09it force-pushed the fix-gemini-speech-config branch from da75207 to d9b6185 Compare October 5, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants